﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace Gronia.WPF.Controls
{
    public partial class StretchPanel : Panel
    {
        public Orientation Orientation
        {
            get { return (Orientation)GetValue(OrientationProperty); }
            set { SetValue(OrientationProperty, value); }
        }

        public ChildOrder ChildrenOrder
        {
            get { return (ChildOrder)GetValue(ChildrenOrderProperty); }
            set { SetValue(ChildrenOrderProperty, value); }
        }

        public double Gap
        {
            get { return (double)GetValue(GapProperty); }
            set { SetValue(GapProperty, value); }
        }

        public static readonly DependencyProperty GapProperty = DependencyProperty.Register("Gap", typeof(double), typeof(StretchPanel), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure));
        public static readonly DependencyProperty OrientationProperty = StackPanel.OrientationProperty.AddOwner(typeof(StretchPanel), new FrameworkPropertyMetadata(Orientation.Vertical, FrameworkPropertyMetadataOptions.AffectsMeasure));
        public static readonly DependencyProperty ChildrenOrderProperty = AlignedWrapPanel.ChildOrderProperty.AddOwner(typeof(StretchPanel), new FrameworkPropertyMetadata(ChildOrder.Normal, FrameworkPropertyMetadataOptions.AffectsMeasure));
    }
}